package com.sghd.fight.module.game.config;

import com.sghd.common.ramcache.anno.Inject;
import com.sghd.common.ramcache.orm.Querier;
import com.sghd.common.ramcache.service.EntityCacheService;
import com.sghd.pojo.fight.game.RoomType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author frank
 * @date 2018-10-24 9:51
 * @desc
 **/
@Component
public class ConfigManager {
    @Inject
    private EntityCacheService<Integer, BuffConfig> buffCache;
    @Inject
    private EntityCacheService<RoomType, RoomConfig> roomCache;
    @Inject
    private EntityCacheService<Integer, SkillConfig> skillCache;
    @Inject
    private EntityCacheService<LevelId,LevelConfig> levelCache;
    @Inject
    private EntityCacheService<Integer,MonsterConfig> monsterCache;

    @Autowired
    private Querier querier;

    public <T> List<T> getAll(Class<T> clz) {
        return querier.all(clz);
    }

    public EntityCacheService<Integer, BuffConfig> getBuffCache() {
        return buffCache;
    }

    public void setBuffCache(EntityCacheService<Integer, BuffConfig> buffCache) {
        this.buffCache = buffCache;
    }

    public EntityCacheService<RoomType, RoomConfig> getRoomCache() {
        return roomCache;
    }

    public void setRoomCache(EntityCacheService<RoomType, RoomConfig> roomCache) {
        this.roomCache = roomCache;
    }

    public EntityCacheService<Integer, SkillConfig> getSkillCache() {
        return skillCache;
    }

    public void setSkillCache(EntityCacheService<Integer, SkillConfig> skillCache) {
        this.skillCache = skillCache;
    }

    public EntityCacheService<LevelId, LevelConfig> getLevelCache() {
        return levelCache;
    }

    public void setLevelCache(EntityCacheService<LevelId, LevelConfig> levelCache) {
        this.levelCache = levelCache;
    }

    public EntityCacheService<Integer, MonsterConfig> getMonsterCache() {
        return monsterCache;
    }

    public void setMonsterCache(EntityCacheService<Integer, MonsterConfig> monsterCache) {
        this.monsterCache = monsterCache;
    }
}
